package com.bingwang.sourcelearn.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author WangBing
 * @date 2023/11/18 08:42
 */
public class ContextUtil {
    public static ApplicationContext getContext(Class<?> clazz) {
        return new AnnotationConfigApplicationContext(clazz);
    }

    public static ApplicationContext getContext(String ...configLocations) {
        return new ClassPathXmlApplicationContext(configLocations);
    }
}
